####################################################
# GUNMOD RADIANCE LIGHTING SYSTEM
# version 2.4
# EDIT OF FEB 28
#
# based on Gunmod's work
# update and edits by dDefinder
####################################################
# FEATURES
####################################################
	ignoreErrors true
	set outsideDiffusionAmbientColor    	(1.0, 1.0, 1.0)
	set outsideFloorAmbient                 0.25
	set outsideWallAmbient                  0.25

	set brightWallFloorContribution       	1
	set darkWallFloorContribution         	1

	seti wallPropagationSteps 		3
	seti floorPropagationSteps 		3

	setf incidenceMapScale 			100
	setf incidenceMapHeightClamp 		1

  	setf roomLightingType 			3

	set roomOverallStrength 		1
	set object:roomOverallStrength 		1.05
	set sim:roomOverallStrength 		1.11
        set wall:roomOverallStrength 		.9
  	setf wall:roomFromLightMapMix      	0
	setf wall:roomFromLightMapStrength 	0

#overite for old
        set roomDirectionalBoost 		.3
	set wall:roomDirectionalBoost  		0.3
	set object:roomDirectionalBoost 	.3
	set sim:roomDirectionalBoost 	 	0.3

	setf sim:roomFromLightMapMix      	0
	setf sim:roomFromLightMapStrength 	0
	setf object:roomFromLightMapMix      	0

	set roomBounceStrength 			.95
	set wall:roomBounceStrength 		.95
	set object:roomBounceStrength 		.95
 	set sim:roomBounceStrength 		.95

	set roomBounceCrossover 		.5
	set wall:roomBounceCrossover 		.5
	set object:roomBounceCrossover 		.5
	set sim:roomBounceCrossover 		.5

	set roomCrossBias 			.5
	set wall:roomCrossBias 			.5
	set object:roomCrossBias 		.5
	set sim:roomCrossBias 			.5

	set roomSideStrength  			0.6
	set wall:roomSideStrength  		0.6
	set object:roomSideStrength  		0.6
	set sim:roomSideStrength  		0.6

	set roomSideCrossover 			.5
	set wall:roomSideCrossover 		.5
	set object:roomSideCrossover 		.5
	set sim:roomSideCrossover 		.5

	set roomSideSlope 			0.5
	set wall:roomSideSlope 			0.5
	set object:SideSlope 			0.5
	set sim:SideSlope  			0.5

	set roomSaturation 			1
	set roomPortalStrength 			1
	set wall:roomPortalStrength 		1
	set object:roomPortalStrength 		1
	set sim:roomPortalStrength 		1
	set roomCeilingStrength 		1
	set wall:roomCeilingStrength 		1
	set object:roomCeilingStrength 		1
	set sim:roomCeilingStrength 		1
	set roomSpecular 			1
	set sim:roomSpecular 			1
	set object:roomSpecular 		1
	set wall:roomSpecular 			1
	set wallDrivenPortals 			1
	setb morningEvening 			true
	setf objectLightJitter 			0
	setf portalLightJitter 			0
	set lightRangeCutoff			0.075

	setf spillPlaneOffset 			0.1
	setf objectLightTransitionTime 		0.01

	set portalSuppressionRadius 		3
	set portalSuppressionAmount 		0.15

        set portalCornerSuppressionAmount 		0.1
        setf portalCornerSuppressionAmount  		0.1
        seti portalCornerSuppressionAmount 		0.1

        set dayLightMapID    				0xeba01cc9
        set nightLightMapID  				0x8ba01cad
        set nhoodLightMapID  				0x0be702ef
        set testMap1ID       				0x917660c
        set testMap2ID       				0x917660d
        set gunmodnightID    				0x6fb59732

	setf hmLotShadowStrength         	1.5
	setf hmNHoodShadowStrength       	0.47
	setf hmSunLightTransitionZone    	1
	setf hmBlobWidthModifier         	0.05
	setf hmBlobHeightModifier        	0.09
	setf hmObjectShadowingBias       	0.1
	setf hmBinaryShadowThreshold     	0.99



####################################################
# Nighttime
####################################################
lightingState night
   control -edith true 
   
   skylight       (.1,.1,.3) .35
   light sun (-2, -2, 2) (.3,.3,.7) .5
   light sky (-2, -2, 2) (.3,.3,.7) .1

   light fill1 (-2, -2, 2) 	(.3,.3,.7) .2  		# 5 #changes brighter
   light fill2 (2, 2, -2) (.3,.3,.7) .3 			#bleed oppsite

   light simFill1  (2, 2, -2)     (.3,.3,.7)  .3        #bleed opposite
   light simFill2  (-2, -1, 2)     (.3,.3,.7)  .4       #near direct

   diffParam insideFloorAmbient 0.03
   diffParam insideWallAmbient  0.03
   diffParam insideAmbientColor (1, 1, 1)
   
   diffParam floorThreshold     .6
   diffParam wallThreshold      .4

   modifiers insidePortals       0  1  .333  .333
   modifiers insidePortalSpills  3.7 .9  1   1
   modifiers outsidePortals      0  0  1    1
   modifiers outsidePortalSpills     2.8    3.0     1     1.8

   modifiers insideObjects      1.2   .45   .2     .25
   modifiers outsideObjects     1   .7  .3   .2

 projectiveShadowStrength 0.4

   portalSaturation 1
   
   environment (.2, .2, .45)    1

   # extra ambient for unlit rooms.
   unlitRoomColor (.2, .2, .23) -threshold .4

   flatShade (1, 1, 1) 1  -sims 1 -objects 1 -indoors 1

   transitionTimes        2                 100
end

# This state is used instead when portal lighting is disabled --
# currently when lighting is set to "medium"
lightingState nightNoPortals : night
   # could do stuff here to compensate for lack of portals.
end
# these are currently unused.

####################################################
# Morning
####################################################
lightingState morning
   control -edith true

skylight       (.6,.4,.3) .15

   light sun (2, -1.5, .5) (.8,.6,.4) 1.2  #this is overall power 1.2 # 10  (1,.8,.2)
   light sky (2, -1.5, .5) (.8,.6,.4) .54   #2:00

   light fill1    (-2, 1.5, -.5)     (.3,.3,.8)    .25
#   light fill1 (0, -2, .5) 	(.5,.4,.1) .015  # 5
#   light fill1 (0, -2, .5) 	(.5,.4,.1) .015  # 5
#   light fill2 (1.8, -2, 2) (.5,.4,.1) .5  # 7

   light simFill1 (-2, 1.5, 2)	(.35,.35,.76) .2	#SKY
   light simFill2 (-2, 5, 2)	(.8,.6,.4) .2	#INdIRECT
   #light simFill3 (2, 1.8, 2) 		(.35,.35,.76) .025

   diffParam insideAmbientColor (1, 1, 1)
   diffParam insideFloorAmbient 0.03
   diffParam insideWallAmbient  0.03
   diffParam floorThreshold     .6
   diffParam wallThreshold      .4

   modifiers insidePortals       0  1  .333  .333
   modifiers insidePortalSpills  3.5  3  .3   .2
   modifiers outsidePortals      0  0  1    1
   modifiers outsidePortalSpills     1     1.5      .65     1
   modifiers insideObjects      1.   .5    .2     .3
   modifiers outsideObjects     .4   .45    .085   .09

   portalSaturation 1

   projectiveShadowStrength 5

   unlitRoomColor (.18, .18, .2) -threshold .5

   flatShade (1, 1, 1) 1  -sims 1 -objects 1 -indoors 1
   environment (.8,.6,.5)    .5
   UIShade (1, 1, 1) 1
   transitionTimes        1                1
end
  

####################################################
# Evening
####################################################
lightingState evening
	 # lightMap   $nhoodLightMapID -strength 1
   control -edith true

   skylight                      (.51,.45,.4)  .4 # Neighborhood terrain, interior sun light; affects shadows

   light sun      (-2.8, 1.3, 1)    (.95,.6,.5)     1.2

###newer1st light sun      (-2.8, 1.3, 1)    (.9,.51,.00)     1.2
###newer2nd   light sun      (-2.8, 1.3, 1)    (.9,.51,.00)     1.7 # overall sun glint color - affects neighbor objects as well #2.0
## ornage   light sky      (2.8, 1.3, 1)  (.9,.5,.00)    .25 # overall sun color mixes with everything including shadows #.15

   light sky      (2.8, 1.3, 2.5)  (.95,.6,.5)    .05 

   light fill1    (1.5,-1.3, -2)     (.45,.3,.8)    .15
   light fill2    (2.8, -1.3, -1)     (.3,.3,.8)    .05  # SKY

   light simFill1  (-2.8, -0, 1) (.95,.6,.5)  .7 
   light simFill2    (2.8, -1.3, -1)     (.3,.3,.8)    .25
   light simFill2  (2.8, -.9, -1) (1,.6,.01)  .15
#   light simFill3  (2,-2,1) (1,.6,.01)  .001 # lesser shadow on sim BLUE

   diffParam insideAmbientColor       (1, 1, 1)
   diffParam insideFloorAmbient         0.03
   diffParam insideWallAmbient          0.03
   diffParam floorThreshold           .8
   diffParam wallThreshold            .6

   modifiers insidePortals       0      .6       .333       .333
   modifiers insidePortalSpills  3      2.1      .3     .2  #### check after incremental #dif 1.7
   modifiers outsidePortals      0      0          1           1
   modifiers outsidePortalSpills 1.5      1.5          0.65           1.3
   modifiers insideObjects      .6     .5        .2     .3
   modifiers outsideObjects    .25    .35     .085     .09

   portalSaturation 1

   projectiveShadowStrength 1

   unlitRoomColor (.18, .18, .2) -threshold .5

   flatShade (1, 1, 1) 1  -sims 1 -objects 1 -indoors 1 # for lighting set to low.

#orange   environment (.95,.6,.5)    .8

   environment (.95,.6,.5) .8
   transitionTimes        1                 1
end



####################################################
# Neighbourhood #DO NOT EDIT#
####################################################
lightingState neighbourhood
   # outside direct lighting
  # skylight (0.65, 0.65, .95) 1
  # light sun    ( 1, -2, 2)     (.9, .855, .8) 1.6
  # light sky    (-1,  2, 1)     (.8, .8, 1)  .9 
 # skylight                      (.87,.925,1)  0.5
  # light sun      (1.5, 1.2, 2)    (1, .94, .875)     1.75
   # light sky      (-1.5, -1.2, 2)  (.8,.8,.8)    .25
    # light fill1    (1, 1, 1)     (1,1,1)    .15

   
  skylight                      (.87,.925,1)  .25
   light sun      (1.75, -2, 1.5)    (1, .9, .8) 1.75
   light sky      (-2, 1.75, 2)  (0.7,.75,.8)   .5
   light fill1    (0, 0, 1)     (1,1,1)     0.25

   lightMap   $nhoodLightMapID
   
   # inside diffusion
   diffParam insideAmbientColor       (1, .95, .75)
   diffParam insideFloorAmbient        .15 
   diffParam insideWallAmbient         .25 
   
   # diffusion inside and outside
   diffParam floorThreshold            0.154
   diffParam wallThreshold             0.12
   
   #               pract. diffuse  p. falloff  d. falloff
   modifiers insidePortals       3      3.8        0.8         .9
   modifiers insidePortalSpills  3      4          .8         1.3
   
   modifiers outsidePortals      0       0          1           1
   modifiers outsidePortalSpills 0       0          1           1

   #                         pract. diffuse  p. falloff  d. falloff
   modifiers insideObjects     1       1         2        1 
   modifiers outsideObjects    0.5     1         4         2  


   # extra ambient for unlit rooms.
   unlitRoomColor (0.01, 0.01, 0.01)
   
   # fog <colour> <nearRange> <farRange>
   # DISABLED pending shader program path support for linear fog.
   #fog (0.9, 0.9, 1) 1200 2200

   flatShade (1, .95, .85) .75  # for lighting quality 0
end

# Only here because the fallback path is currently broken.
lightingState neighbourhoodNoPortals : neighbourhood
   lightMap $nhoodLightMapID
   skylight                      (.87,.925,1)  .25
   light sun      (1.75, -2, 1.5)    (1, .9, .8) 1.75
   light sky      (-2, 1.75, 2)  (0.7,.75,.8)   .5
   light fill1    (0, 0, 1)     (1,1,1)     0.25
   lightMap 0x0be702ef
   diffParam insideAmbientColor       (1, .95, .75)
   diffParam insideFloorAmbient        .15
   diffParam insideWallAmbient         .25
   diffParam floorThreshold            0.154
   diffParam wallThreshold             0.12
   modifiers insidePortals       3      3.8        0.8         .9
   modifiers insidePortalSpills  3      4          .8         1.3
   modifiers outsidePortals      0       0          1           1
   modifiers outsidePortalSpills 0       0          1           1
   modifiers insideObjects     1       1         2        1
   modifiers outsideObjects    0.5     1         4         2
   unlitRoomColor (0.01, 0.01, 0.01)
   flatShade (1, .95, .85) .75  # for lighting quality 0
   environment (1, 1, 1) 1.0  # override environment lighting state
end

# Used to generate imposters from lot houses.
lightingState neighbourhoodImposter : neighbourhood


 skylight                      (.87,.925,1)  0.5
   light sun      (-2, -2, 1.5)  (1, .9, .8) 1.5
   light sky      (2, 2, 2)  (.7,.75,.8)   .35
   light fill1    (0,0,1)   (1,1,1)     .25
      
   lightMap  0 # disable light map
# lightMap $nhoodLightMapID
   # inside diffusion
   diffParam insideAmbientColor       (.75, .75, .75)  
   diffParam insideFloorAmbient         0.001  
   diffParam insideWallAmbient          0.001  
   
   # diffusion inside and outside
   diffParam floorThreshold            .4
   diffParam wallThreshold             .4
   
   portalSaturation 1

   # modifiers <type> <practicalStrength:float> <diffusionStrength:float> [<practicalFalloff:float> <diffusionFalloff:float>] 
   
   #                           pract. diffuse  p. falloff  d. falloff
   modifiers insidePortals       1.25 1.25           .5          .5
   modifiers insidePortalSpills  1.25 1.25           .5          .5
   
   
   modifiers outsidePortals      0       0          1           1
   modifiers outsidePortalSpills 0       0          1           1

   #                         pract. diffuse  p. falloff  d. falloff
   modifiers insideObjects     .9        .75    .33  0.5
   modifiers outsideObjects    0       0         1 1
    
   # extra ambient for unlit rooms.
   # Alon's values: unlitRoomColor (.1, .1, .09) -threshold .4   
   unlitRoomColor (.275, .275, .275) -threshold .33
#  unlitRoomColor (0,0,0) -threshold .33
   #lightMap $dayLightMapID -strength 1

   # UI Lighting Parameter (based on but not identical to skyLight param.)
   UIShade (1, 1, 1) 1   
    
   flatShade (1, .95, .85) 0.7  # for lighting set to low.

   environment (1, 1, 1) 1

end

####################################################
# Lot Night - Vacation Lot - Taken from the Base Game lighting.txt
####################################################
lightingState vacationNight 
   control -edith true
   
   skylight       (.1,.1,.3) .35
   light sun (-2, -2, 2) (.3,.3,.7) .5
   light sky (-2, -2, 2) (.3,.3,.7) .1

   light fill1 (-2, -2, 2) 	(.3,.3,.7) .2  		# 5 #changes brighter
   light fill2 (2, 2, -2) (.3,.3,.7) .3 			#bleed oppsite

   light simFill1  (2, 2, -2)     (.3,.3,.7)  .3        #bleed opposite
   light simFill2  (-2, -1, 2)     (.3,.3,.7)  .4       #near direct

   diffParam insideFloorAmbient 0.03
   diffParam insideWallAmbient  0.03
   diffParam insideAmbientColor (1, 1, 1)
   
   diffParam floorThreshold     .6
   diffParam wallThreshold      .4

   modifiers insidePortals       0  1  .333  .333
   modifiers insidePortalSpills  3.7 .9  1   1
   modifiers outsidePortals      0  0  1    1
   modifiers outsidePortalSpills     2.8    3.0     1     1.8

   modifiers insideObjects      1.2   .45   .2     .25
   modifiers outsideObjects     1   .7  .3   .2

 projectiveShadowStrength 0.4

   portalSaturation 1
   
   environment (.2, .2, .45)    1

   # extra ambient for unlit rooms.
   unlitRoomColor (.2, .2, .23) -threshold .4

   flatShade (1, 1, 1) 1  -sims 1 -objects 1 -indoors 1

   transitionTimes        2                 100
end

###############################################################################
# Added from Nightlife text for all EP's
###############################################################################
lightingState neighborhoodnight
 
   skylight       (.1,.1,.3) .35
   light sun (-2, -2, 2) (.3,.3,.7) .2 # 10
   lightMap   0x6fb59732
   
   diffParam insideFloorAmbient 0.03
   diffParam insideWallAmbient  0.03
   diffParam insideAmbientColor (1, 1, 1)
   diffParam floorThreshold     .6
   diffParam wallThreshold      .4
   
   modifiers insidePortals       0  1  .333  .333
   modifiers insidePortalSpills  3.7 1.  1   1
   modifiers outsidePortals      0  0  1    1
   modifiers outsidePortalSpills     4    5.8      .4     .6
   modifiers insideObjects      1.2   .5    .2     .3
   modifiers outsideObjects     1   .8  .3   .2

   unlitRoomColor (0.001, 0.001, 0.001)
   flatShade (.3, .35, .9) .5  # for lighting quality 0
   environment (.2, .2, .45)    1  # override environment lighting state
end

####################################################
# Season - Summer/Daytime
####################################################
lightingState day
   control -edith true

   skylight                      (.95,.95,.95)  0.4 # INDOOR COLORS

#   light sun      (1., 1.5, 1.5)    (1,1,.9)     1.6 # OUTDOOR LIGHT MAIN
light sun      (1., 1.38, 1.5)    (1,1,.98)     1.6


   light sky      (-1.5, .2, 2)  (.4,.4,.7)    .35 

   light fill1    (-1.5,-2.5, -2)     (.8,.8,.8)    .35
   light fill2    (-10.5, -10.5, -2)     (.6,.6,.6)    .55   #indirect sunlight

    light simFill1  (-2.5, -1.5, 5)     (.4,.4,.6)  .95         #sky

    light simFill2  (-1., -1, -1.5)    (1,1,.98)     .5   #direct
##    light simFill2  (1, -.8, 2)    (1,1,.98)     .9   #direct

    light simFill3  (-5.,-2.5, -5)     (.8,.8,.8)    .15      #floor indirect bounce

   # inside diffusion
   diffParam insideAmbientColor       (1, 1, 1)  
   diffParam insideFloorAmbient 0.03
   diffParam insideWallAmbient  0.03  
   
   # diffusion inside and outside
   diffParam floorThreshold           .6
   diffParam wallThreshold            .4
   
   portalSaturation 1

   # modifiers <type> <practicalStrength:float> <diffusionStrength:float> [<practicalFalloff:float> <diffusionFalloff:float>] 
   
   #                           pract. diffuse  p. falloff  d. falloff
   modifiers insidePortals        0    	 0            1         1
   modifiers insidePortalSpills   1.1    2.55      .12     .28 #1.44    #changed all d. falloff from .32 including other seasons

#lastest     modifiers insidePortalSpills   1.1    2.55      .12     .28 #1.44    #changed all d. falloff from .32 including other seasons


##   modifiers insidePortals       0  1.2  	.01 	 .3
##   modifiers insidePortalSpills  .55   3.3       .008        .35
   modifiers outsidePortals      0  0  1    1
   modifiers outsidePortalSpills     0     0      1     1

   #                         pract. diffuse  p. falloff  d. falloff
   modifiers insideObjects      .8   .5    .2     .3
   modifiers outsideObjects    .2      .25     .085 .09


  projectiveShadowStrength 0.83

   # extra ambient for unlit rooms.
   unlitRoomColor (.2, .2, .23) -threshold .4

   flatShade (1, .95, .85) .75  -sims 1.7 -objects 1.3 -indoors 1 # for lighting set to low.

   environment (1, 1, 1) 1
   
   #               max in time (s)   max out time (s)
   transitionTimes        2                 100
end
lightingState dayNoPortals : day
end


####################################################
# Season - Winter
####################################################
lightingState Winter
   control -edith true

   # outside direct lighting
   
   skylight                      (.95,.95,.95)  0.4 #overall mostly shadow

   light sun      (1.1, 1.5, 1.45)    (.87,.85,.91)     1.7 #main light ##(.89 ,.88,.92) 

   light sky      (-1.5, -1.2, 2)  (.87,.95,.93)    .35 #shadow

   light fill1    (-1.5,-2.5, -2)     (.8,.8,.8)    .35
   light fill2    (-10.5, -10.5, -2)     (.6,.6,.6)    .35   #indirect sunlight

    light simFill1  (-2.5, -1.5, 5)     (.4,.4,.6)  .95         #sky
    light simFill2  (-1., -1, -1.5)    (1,1,.98)     .5   #direct   #direct
    light simFill3  (-5.,-2.5, -5)     (.8,.8,.8)    .15      #floor indirect bounce

   # inside diffusion
   diffParam insideAmbientColor       (1, 1, 1)  
   diffParam insideFloorAmbient         0.03  
   diffParam insideWallAmbient          0.03  
   
   # diffusion inside and outside
   diffParam floorThreshold           .6
   diffParam wallThreshold            .4
   
projectiveShadowStrength 0.7

   portalSaturation 1

   # modifiers <type> <practicalStrength:float> <diffusionStrength:float> [<practicalFalloff:float> <diffusionFalloff:float>] 
   
   #                           pract. diffuse  p. falloff  d. falloff
   modifiers insidePortals        0    	 0            1         1
   modifiers insidePortalSpills   1.1    2.55      .12     .28
##   modifiers insidePortals       0  1.2  	.01 	 .3
##   modifiers insidePortalSpills  .875   3.3       .008        .37
   modifiers outsidePortals      0  0  1    1
   modifiers outsidePortalSpills     0     0      1     1

   #                         pract. diffuse  p. falloff  d. falloff
   modifiers insideObjects      .85   .5    .2     .3
   modifiers outsideObjects    .2      .25     .085 .09

   # extra ambient for unlit rooms.
   unlitRoomColor (.2, .2, .23) -threshold .4

   flatShade (1, .95, .85) .75  -sims 1.7 -objects 1.3 -indoors 1 # for lighting set to low.

   environment (1, 1, 1) 1
   
   #               max in time (s)   max out time (s)
   transitionTimes        2                 100
end

####################################################
# Season - Spring
####################################################
lightingState Spring
   control -edith true

   skylight                      (.95,.95,.95)  0.4 #overall mostly shadow

   light sun      (1.8, 1.5, 1.48)    (.98, 1, .96)     1.65 #main light  (0.9, 0.88, 0.85) 

   light sky      (-1.5, -1.2, 2)  (1,.99,.75)    .35 #shadow

   light fill1    (-1.5,-2.5, -2)     (.8,.8,.8)    .35
   light fill2    (-10.5, -10.5, -2)     (.6,.6,.6)    .35   #indirect sunlight

    light simFill1  (-2.5, -1.5, 5)     (.4,.4,.6)  .95         #sky
    light simFill2  (-1., -1, -1.5)    (1,1,.98)     .5   #direct
    light simFill3  (-5.,-2.5, -5)     (.8,.8,.8)    .15      #floor indirect bounce

projectiveShadowStrength .7


   # inside diffusion
   diffParam insideAmbientColor       (1, 1, 1)  
   diffParam insideFloorAmbient         0.03  
   diffParam insideWallAmbient          0.03  
   
   # diffusion inside and outside
   diffParam floorThreshold           .6
   diffParam wallThreshold            .4
   

   portalSaturation 1

   # modifiers <type> <practicalStrength:float> <diffusionStrength:float> [<practicalFalloff:float> <diffusionFalloff:float>] 
   
   #                           pract. diffuse  p. falloff  d. falloff
   modifiers insidePortals        0    	 0            1         1
   modifiers insidePortalSpills   1.1    2.55      .12     .28
##   modifiers insidePortals       0  1.2  	.01 	 .3
##   modifiers insidePortalSpills  .8   3.3       .008        .4
   modifiers outsidePortals      0  0  1    1
   modifiers outsidePortalSpills     0     0      1     1

   #                         pract. diffuse  p. falloff  d. falloff
   modifiers insideObjects      .8   .5    .1     .3
   modifiers outsideObjects    .2      .25     .085 .09

   # extra ambient for unlit rooms.
   unlitRoomColor (.2, .2, .23) -threshold .4

   flatShade (1, .95, .85) .75  -sims 1.7 -objects 1.3 -indoors 1 # for lighting set to low.

   environment (1, 1, 1) 1
   
   #               max in time (s)   max out time (s)
   transitionTimes        2                 100
end

####################################################
# Season - Autumn
####################################################
lightingState Autumn
   control -edith true

   skylight                      (.95,.95,.95)  0.4 #overall mostly shadow

   light sun      (1.6, 1.5, 1.54)    (.98, .93, .77)     1.65 #main light

   light sky      (-1.5, -1.2, 2)  (1,.8,.6)    .35 #shadow

   light fill1    (-1.5,-2.5, -2)     (.8,.8,.8)    .35
   light fill2    (-10.5, -10.5, -2)     (.6,.6,.6)    .55   #indirect sunlight

    light simFill1  (-2.5, -1.5, 5)     (.4,.4,.6)  .95         #sky
    light simFill2  (-1., -1, -1.5)    (1,1,.98)     .5   #direct
    light simFill3  (-5.,-2.5, -5)     (.8,.8,.8)    .15      #floor indirect bounce

projectiveShadowStrength 0.8

   # inside diffusion
   diffParam insideAmbientColor       (1, 1, 1)  
   diffParam insideFloorAmbient         0.03  
   diffParam insideWallAmbient          0.03  
   
   # diffusion inside and outside
   diffParam floorThreshold           .6
   diffParam wallThreshold            .4
   

   portalSaturation 1

   # modifiers <type> <practicalStrength:float> <diffusionStrength:float> [<practicalFalloff:float> <diffusionFalloff:float>] 
   
   #                           pract. diffuse  p. falloff  d. falloff
   modifiers insidePortals        0    	 0            1         1
   modifiers insidePortalSpills   1.1    2.55      .12     .28
##   modifiers insidePortals       0  1.2  	.01 	 .3
##   modifiers insidePortalSpills  .88   3       .008        .4
   modifiers outsidePortals      0  0  1    1
   modifiers outsidePortalSpills     0     0      1     1

   #                         pract. diffuse  p. falloff  d. falloff
   modifiers insideObjects      .8   .5    .2     .3
   modifiers outsideObjects    .2      .25     .085 .09

   # extra ambient for unlit rooms.
   unlitRoomColor (.2, .2, .23) -threshold .4

   flatShade (1, .95, .85) .75  -sims 1.7 -objects 1.3 -indoors 1 # for lighting set to low.

   environment (1, 1, 1) 1
   
   #               max in time (s)   max out time (s)
   transitionTimes        2                 100
end

####################################################
# Season - Overcast
####################################################
lightingState Overcast
   control -edith true

   # outside direct lighting
   

  skylight                      (.93,.93,.93)  0.4 #overall mostly shadow

   light sun      (1.1, 1.5, 2)    (.895,.895,.895)     1.5 #main light ##(.89 ,.88,.92) 

   light sky      (-1.5, -1.2, 2)  (.895,.895,.895)    .25 #shadow

   light fill1    (-1.5,-2.5, -2)     (.8,.8,.8)    .25
   light fill2    (-10.5, -10.5, -2)     (.6,.6,.6)    .25   #indirect sunlight

    light simFill1  (-2.5, -1.5, 5)     (.6,.6,.6)  .75         #sky
    light simFill2  (1, -.8, 2)    (1,1,1)     .7   #direct
    light simFill3  (-5.,-2.5, -5)     (.8,.8,.8)    .15      #floor indirect bounce

   # inside diffusion
   diffParam insideAmbientColor       (1, 1, 1)  
   diffParam insideFloorAmbient         0.03 
   diffParam insideWallAmbient          0.03  
   
   # diffusion inside and outside
   diffParam floorThreshold           .4
   diffParam wallThreshold            .4
   
projectiveShadowStrength 0.7

   portalSaturation 1

   # modifiers <type> <practicalStrength:float> <diffusionStrength:float> [<practicalFalloff:float> <diffusionFalloff:float>] 
   
   #                           pract. diffuse  p. falloff  d. falloff
   modifiers insidePortals        0    	 0            1         1
   modifiers insidePortalSpills   1.22    2.4      .12     .38
##   modifiers insidePortals       0  1.2  	.01 	 .3
##   modifiers insidePortalSpills  .875   3.3       .008        .37
   modifiers outsidePortals      0  0  1    1
   modifiers outsidePortalSpills     0     0      1     1

   #                         pract. diffuse  p. falloff  d. falloff
   modifiers insideObjects      .85   .5    .2     .3
   modifiers outsideObjects    .2      .25     .085 .09

   # extra ambient for unlit rooms.
   unlitRoomColor (.2, .2, .23) -threshold .4

   flatShade (1, .95, .85) .75  -sims 1.7 -objects 1.3 -indoors 1 # for lighting set to low.

   environment (1, 1, 1) 1
   
   #               max in time (s)   max out time (s)
   transitionTimes        2                 100
end

####################################################
# CAS
####################################################
lightingState CAS
    # outside direct lighting
   skylight                      (.87,.925,1)  .3
   light sun      (1.5, 1, 2)    (1, .94, .875)      1
   light sky      (-1.5, -1, 2)  (.8,.8,.8)    .5
   light fill1    (1, 1, 1)     (1,1,1)    .5

  # light simFill1  (1.5, 1, 2) (1, 1, 1)  0.5
  # light simFill2  (-2, -1, 2) (1, 1, 1)  .5

   # inside diffusion
   diffParam insideAmbientColor       (0,0,0)  
   diffParam insideFloorAmbient         0.001  
   diffParam insideWallAmbient          0.001  
   
   # diffusion inside and outside
   diffParam floorThreshold            .25
   diffParam wallThreshold             .25
   
   portalSaturation 1

   # modifiers <type> <practicalStrength:float> <diffusionStrength:float> [<practicalFalloff:float> <diffusionFalloff:float>] 
   
   #                           pract. diffuse  p. falloff  d. falloff
   modifiers insidePortals       1    0.75           .008        1
   modifiers insidePortalSpills  0   .25           .65          1
   
   
   modifiers outsidePortals      0       0          1           1
   modifiers outsidePortalSpills 0       0          1           1

   #                         pract. diffuse  p. falloff  d. falloff
   modifiers insideObjects     .65    .75   .08    .4
   modifiers outsideObjects    .65       .5         1 1
    
   # extra ambient for unlit rooms.
   # Alon's values: unlitRoomColor (.1, .1, .09) -threshold .4   
   unlitRoomColor (.175, .142, .1) -threshold .175
   unlitRoomColor (.2, .172, .15) -threshold .175
#  unlitRoomColor (0,0,0) -threshold .33
   #lightMap $dayLightMapID -strength 1

   # UI Lighting Parameter (based on but not identical to skyLight param.)
   UIShade (1, 1, 1) 1   
    
   flatShade (.001, .001, .001) 0.7  # for lighting set to low.

   environment (1, 1, 1) 1
end

# Material tuning flat lighting states
# Flat ambient illumination of the given percentage.
lightingState mat000
   skylight                     (0, 0, 0)
   flatShade                    (0, 0, 0)
   environment                  (0, 0, 0)
   
   diffParam insideAmbientColor (0, 0, 0)  

   diffParam insideFloorAmbient         0.5
   diffParam insideWallAmbient          1
      
   modifiers insidePortals       0       0           
   modifiers outsidePortals      0       0              
   modifiers insidePortalSpills  0       0           
   modifiers outsidePortalSpills 0       0              
   modifiers insideObjects       0       0         
   modifiers outsideObjects      0       0         
end

define matState(pct)
   set shade (&pct / 100)
   lightingState mat&{pct} : mat000
      skylight                     ($shade, $shade, $shade)
      flatShade                    ($shade, $shade, $shade)
      environment                  ($shade, $shade, $shade)
      diffParam insideAmbientColor ($shade, $shade, $shade)     
   end
enddef

create matState(050)
create matState(100)
create matState(150)
create matState(200)
create matState(300)
create matState(400)

####################################################
# External lighting
#


# Strength of outdoor lighting for walls/objects.
# Ideally these would both be 1, and our object
# materials would all be tuned to look consistent
# with such lighting. But that's not
# the case at the moment.
setf outdoorStrength 1
# terrain strength is currently specified separately.
setf terrainStrength 1


####################################################
# Light map parameters
#
# Don't touch unless you know what you're doing.

# these are actually page sizes
seti floorTextureSize 512
seti wallTextureSize 256

# 4/8 triggers direct guard tile->texture mapping.
# Otherwise, need y = 3 * x.
seti wallTileSizeX 8
seti wallTileSizeY 24

setb lightMapDebug false


####################################################
# Lighting overrides
#

# Light overrides are in a separate file
#include "LotLights.txt"

#CALL RLS MAIN FILES
include "RLS-Main.txt"